package com.itheima.zhuanhuan;

public class Test {
    public static void main(String[] args) {
        Zi zi = new Zi("zhangsan",28);
        zi.sing();
    }
}
class Fu {
    private String name;
    public Fu() {
    }
    public Fu(String name) {
        this.name = name;
    }
    public void sing(){
        System.out.println("父类的sing");
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
}
class Zi extends Fu{
    private String name;
    private int age;
    public Zi() {
    }
    public Zi(String name, int age) {
        super(name);
        this.age = age;
    }
    @Override
    public void sing() {
        System.out.println("子类的sing");
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
}

